﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WebAuto
{
    public partial class WebBrowser : Form
    {
        public WebBrowser()
        {
            InitializeComponent();
        }

        public void InjectHTML(string html,string url)
        {
            string fullHTML ="<!DOCTYPE html PUBLIC \" -//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
            fullHTML += "<html xmlns=\"http://www.w3.org/1999/xhtml\" >";
            fullHTML += html;
            fullHTML += "</html>";



            webBrowser1.DocumentText = "";
            webBrowser1.DocumentText = fullHTML;
            webBrowser1.DocumentText = webBrowser1.DocumentText.Replace("about:blank:/", url);

        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void WebBrowser_Load(object sender, EventArgs e)
        {

        }

        private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {

        }
    }
}
